perm_check Interface

interface
public subroutine perm_check(n, p, ierror)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: n

The number of entries.

integer(kind=int32), intent(in) :: p(n)

The array to check.

integer(kind=int32), intent(out) :: ierror

0, the array represents a permutation. nonzero, the array does not represent a permutation. The smallest missing value is equal to IERROR.

Description

Checks that a vector represents a permutation.

The routine verifies that each of the values from 1 to N occurs among the N entries of the permutation.